您没有管理本页面的权限。"
dvbbs_error()
Else
select case request("action")
case "save1"
save1()
case "save2"
save2()
case "save3"
save3()
case "search"
search()
case "view"
view()
case "edit"
edit()
case "del"
del()
case else
consted()
end select
If founderr then call dvbbs_error()
footer()
End If
sub consted()
dim sel
%>
<%
end sub
sub save1()
dim title,content,parentid,stype
if Request.form("classid")="0" then
if request("classtitle")="" then
Errmsg="如果您选择添加一级分类,请填写选择下拉框的左边输入框"
founderr=true
exit sub
else
title=request("classtitle")
end if
ParentID=0
else
if request("title")="" then
Errmsg="请填写帮助标题"
founderr=true
exit sub
else
title=request("title")
end if
ParentID=Request.form("classid")
end if
if request("stype")="1" then
stype=1
else
stype=0
end if
set rs=server.createobject("adodb.recordset")
sql="select * from dv_help"
rs.open sql,conn,1,3
rs.addnew
rs("h_parentid")=parentid
rs("h_title")=FilterJS(title)
rs("h_content")=replace(FilterJS(request.form("content")),chr(10)," ")
rs("h_bgimg")=FilterJS(request.form("targeturl"))
rs("h_type")=0
rs("h_stype")=stype
rs.update
rs.close
set rs=nothing
dv_suc("保存前台帮助成功!")
end sub
sub save3()
dim title,content,parentid,stype
if request("classid")="0" then
if request("classtitle")="" then
Errmsg="如果您选择添加一级分类,请填写选择下拉框的左边输入框"
founderr=true
exit sub
else
title=request("classtitle")
end if
ParentID=0
else
if request("title")="" then
Errmsg="请填写帮助标题"
founderr=true
exit sub
else
title=request("title")
end if
ParentID=request("classid")
end if
if request("stype")="1" then
stype=1
else
stype=0
end if
set rs=server.createobject("adodb.recordset")
sql="select * from dv_help where h_id="&request("id")
rs.open sql,conn,1,3
if not rs.eof then
rs("h_parentid")=parentid
rs("h_title")=FilterJS(title)
rs("h_content")=replace(FilterJS(request("content")),chr(10)," ")
rs("h_bgimg")=FilterJS(request("targeturl"))
rs("h_type")=request("ctype")
rs("h_stype")=stype
end if
rs.update
rs.close
set rs=nothing
dv_suc("保存后台帮助成功!")
end sub
Function FilterJS(v)
If not isnull(v) then
dim t
dim re
dim reContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
re.Pattern="(javascript)"
t=re.Replace(v,"javascript")
re.Pattern="(jscript:)"
t=re.Replace(t,"jscript:")
re.Pattern="(js:)"
t=re.Replace(t,"js:")
re.Pattern="(value)"
t=re.Replace(t,"value")
re.Pattern="(about:)"
t=re.Replace(t,"about:")
re.Pattern="(file:)"
t=re.Replace(t,"file:")
re.Pattern="(document.cookie)"
t=re.Replace(t,"documents.cookie")
re.Pattern="(vbscript:)"
t=re.Replace(t,"vbscript:")
re.Pattern="(vbs:)"
t=re.Replace(t,"vbs:")
re.Pattern="(on(mouse|exit|error|click|key))"
t=re.Replace(t,"on$2")
re.Pattern="()"
t=re.Replace(t,"&#")
FilterJS=t
set re=nothing
End if
End Function
function search()
%>
论坛帮助和后台菜单管理列表
<%
dim keyword,currentpage,page_count,totalrec
set rs=server.createobject("adodb.recordset")
if request("stype")<>"" then
sql=" h_type="&request("stype")
end if
if request("keyword")<>"" then
if sql<>"" then
sql=sql & " and h_title like '%"&replace(request("keyword"),"'","")&"%' or h_content like '%"&replace(request("keyword"),"'","")&"%'"
else
sql=" h_title like '%"&replace(request("keyword"),"'","")&"%' or h_content like '%"&replace(request("keyword"),"'","")&"%'"
end if
end if
if sql="" then
sql="select * from dv_help where not h_id=1 order by h_id desc"
else
sql="select * from dv_help where "&sql&" and not h_id=1 order by h_id desc"
end if
rs.open sql,conn,1,1
currentPage=request("page")
if currentpage="" or not IsNumeric(currentpage) then
currentpage=1
else
currentpage=clng(currentpage)
end if
if not rs.eof then
rs.PageSize = 10
rs.AbsolutePage=currentpage
page_count=0
totalrec=rs.recordcount
while (not rs.eof) and (not page_count = rs.PageSize)
%>
<%
if not isnull(rs("h_content")) and rs("h_content")<>"" then
Response.Write left(replace(replace(rs("h_content")," "," ")," "," "),100)
else
if rs("H_ParentID")=0 then
Response.Write "此项为一级分类标题!"
Else
Response.Write "本条帮助没有录入内容!"
End If
end if
%>
<%
end if
rs.close
set rs=nothing
dim pcount,endpage
if totalrec mod 10=0 then
Pcount= totalrec \ 10
else
Pcount= totalrec \ 10+1
end if
response.write "
分页:"
if currentpage > 4 then
response.write "[1] ..."
end if
if Pcount>currentpage+3 then
endpage=currentpage+3
else
endpage=Pcount
end if
for i=currentpage-3 to endpage
if not i<1 then
if i = clng(currentpage) then
response.write " ["&i&"]"
else
response.write " ["&i&"]"
end if
end if
next
if currentpage+3 < Pcount then
response.write "... ["&Pcount&"]"
end if
response.write "
"
%>
<%
end function
function view()
%>
查看论坛帮助
<%
set rs=Dvbbs.Execute("select * from dv_help where h_id="&request("id"))
if rs.eof and rs.bof then
Response.Write "没有找到帮助"
else
Response.Write "
<%
dim trs
set rs=Dvbbs.Execute("select * from dv_help where h_id="&request("id"))
if rs.eof and rs.bof then
Response.Write "没有找到帮助"
else
%>
<%
end if
%>
<%
end function
function del()
Dvbbs.Execute("delete from dv_help where (not h_id=1) and h_id="&Request("id"))
dv_suc("删除论坛帮助成功!")
end function
%>